package lab02.test11;

public class Rectangle implements Printx {
    //属性
    double length;
    double width;

    //行为
    double area() {
        return length * width;
    }

    double perimeter() {
        return 2 * (length + width);
    }

    //重写
    @Override
    public void printMyWay() {
        System.out.println("矩形长为：" + length);
        System.out.println("矩形宽为：" + width);
        System.out.println("矩形面积为：" + (length * width));
        System.out.println("矩形周长为：" + (2 * (length + width)));
    }
}
